Closed Bug 1161666 Opened 10 years ago Closed 10 years ago

|extract_signature| leaks memory if |sigIndex| > 0 (command line build utility)

Categories

(Toolkit :: Application Update, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla40
Tracking Status
firefox40 --- fixed

People

(Reporter: erahm, Assigned: joseriosneto, Mentored)

References

(Blocks 1 open bug)

Details

(Keywords: coverity, Whiteboard: [CID 1293421][lang=c++][good first bug])

Attachments

(1 file)

Coverity reports that |mar_read_entire_file| leaks the previous allocation of |extractedSignature| [1] on each iteration of the for loop. [1] https://hg.mozilla.org/mozilla-central/annotate/754579ec0e68/modules/libmar/sign/mar_sign.c#l550
Summary: |extract_signature| leaks memory if |sigIndex| > 0 → |extract_signature| leaks memory if |sigIndex| > 0 (command line build utility)
Mentor: erahm
Whiteboard: [CID 1293421] → [CID 1293421][lang=c++][good first bug]
Hello Eric, can I take this bug?
Hi José, feel free to take this bug. Thanks!
Robert, here's a first patch for the problem. I tried to avoid another condition after fread and added a comment for readability.
Attachment #8602478 - Flags: review?(robert.strong.bugs)
Comment on attachment 8602478 [details] [diff] [review] bug1161666_fix_leak_v1.patch Works for me since calling free on NULL is safe. Thanks again!
Attachment #8602478 - Flags: review?(robert.strong.bugs) → review+
Since the trees are closed I'll probably land this and your other patch tomorrow.
Assignee: nobody → joseriosneto
Yep! Thank you again :)
Flags: in-testsuite-
Target Milestone: --- → mozilla40
Mentor: robert.strong.bugs
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: